<template>
    <div class="activity">
        <div class="top-picWrap">
            <div class="img">
                <img :src="indexActivityModule?.picUrl"
                    alt="">
            </div>
            <div class="top-discount">
                <div class="line1">{{ indexActivityModule?.originPrice }}</div>
                <div class="line2">{{ indexActivityModule?.activityPrice }}</div>
            </div>
        </div>
        <div class="top-cnt">
            <div class="cnt-title">{{ indexActivityModule?.title }}</div>
            <div class="subTitle">{{ indexActivityModule?.subTitle }}</div>
            <div class="cnt-tag" v-if="!flag">{{ indexActivityModule?.tag }}</div>
        </div>
    </div>
</template>

<script lang="ts">
import { defineComponent } from "vue"
export default defineComponent({
    name: 'NewGift',
})
</script>

<script lang="ts" setup>
import type {IndexActivityData} from '@/api/home'
const props = defineProps<{
    indexActivityModule:IndexActivityData,
    flag?:boolean
}>()
</script>

<style scoped>
.activity {
  width: 171.5px;
  height: 107.5px;
  color: #333;
  font-size: 12px;
  float: left;
  box-sizing: border-box;
  margin: 0 2px 2px 0;
  padding: 10px 0 0 15px;
  position: relative;
}

.activity .top-picWrap .img {
  width: 100px;
  height: 100px;
  position: absolute;
  right: 0;
  top: 8px;
}

.activity .top-picWrap .img img {
  width: 100%;
  height: auto;
}

.activity .top-picWrap .top-discount {
  width: 40px;
  height: 35px;
  background: #f59524;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  right: 12px;
  opacity: 0.8;
  color: #fff;
  padding-top: 5px;
  text-align: center;
}

.activity .top-picWrap .top-discount .line1 {
  font-size: 12px;
}

.activity .top-picWrap .top-discount .line2 {
  font-size: 12px;
  margin-top: 3.5px;
  text-decoration: line-through;
}

.activity .top-cnt {
  position: relative;
}

.activity .top-cnt .cnt-title {
  font-family: PingFangSC-Medium;
  font-size: 16px;
}

.activity .top-cnt .subTitle {
  color: #7f7f7f;
}

.activity .top-cnt .cnt-tag{
  position: relative;
  display: inline-block;
  height:16px;
  line-height: 16px;
  padding:0 5px;
  font-size: 12px;
  background: #cbb693;
  color: #fff;
  border-radius: 2px;
  text-align: center;
}

</style>